import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/label_button.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class UnderBtnWithLabel extends StatelessWidget {
  final String label;
  final VoidCallback onTap;
  final bool enabled;

  const UnderBtnWithLabel({
    Key key,
    this.label,
    this.onTap,
    this.enabled = true,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(
        vertical: 15.w,
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          Container(
            child: Text(
              label,
              style: TextStyleConstant().normal_3_20,
            ),
            alignment: Alignment.centerLeft,
          ),
          if (enabled)
            Container(
              margin: EdgeInsets.only(
                top: 15.w,
              ),
              alignment: Alignment.centerRight,
              child: LabelButton(
                title: '+继续添加',
                onTap: onTap,
              ),
            ),
        ],
      ),
    );
  }
}
